<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>新建人员</title>
    <link rel="stylesheet" href="${base}/static/res/manage/css/common.css" >
    <link rel="stylesheet" href="${base}/static/res/manage/css/ec.css" >
    <link rel="stylesheet" href="${base}/static/res/manage/css/list.css" >
    <script type="text/javascript" src="${base}/static/res/plugin/jquery/jquery-1.11.1.min.js"></script>
    <script type="text/javascript" src="${base}/static/res/plugin/validator/jquery.validate.min.js"></script>
    <script type="text/javascript" src="${base}/static/res/admin/js/common.js"></script>
    <script type="text/javascript">
        $(function(){

            $("#inputForm").validate({
                rules:{
                    userName:{
                        required:true,
                        checkUserName:true
                    },
                    password:{
                        required:true,
                        checkPassword:true
                    },
                    repassword:{
                        required:true,
                        checkPassword:true,
                        equalTo:"#password"
                    },
                    mobile:{
                        required:true,
                        mobile:true,
                        remote: {
                            url:"checkMobile.jhtml",
                            cache:false
                        }
                    },
                    email:{
                        email:true
                    }
                },
                messages:{
                    mobile:{
                        remote:"手机号重复"
                    },
                    repassword:{
                        equalTo:"密码不一致，请重新输入"
                    }
                }
            });

        });
    </script>
</head>
<body>
    <form id="inputForm" action="save.jhtml" method="post">
        <div class="tab set arr">
            <h3><a href="list.jhtml">人员管理</a><a href="add.jhtml">>  新建人员</a></h3>
            <div class="tablist message">
				<table cellpadding="0" cellspacing="0">
					<tr>
						<td><label>人员名称<span class="cred">*</span></label></td>
						<td>
							<input type="text" name="userName" id="userName"/>
						</td>
						<td><label>手机号码<span class="cred"> * </span></label></td>
						<td><input type="text" name="mobile" /></td>
					</tr>
					<tr>
						<td><label>人员密码<span class="cred"> * </span></label></td>
						<td>
							<input type="password" name="password" id="password"/>
						</td>
						<td><label>人员邮箱</label></td>
						<td><input type="text" name="email" /></td>
					</tr>
					<tr>
						<td><label>确认密码<span class="cred"> * </span></label></td>
						<td>
							<input type="password" name="repassword"/>
						</td>

					</tr>
                    <tr>
						<td><label>是否可用<span class="cred"> * </span></label></td>
						<td>
                            <label><input type="radio" name="status" class="sex" value="0" checked>是</label>
                            <label><input type="radio" name="status" class="sex" value="1">否</label>
						</td>

                    </tr>
                    <tr class="check">
                        <td><label>角色</label></td>
                        <td>
                            [#list roles as role]
                                [#if role.roleCode != "ROLE_ADMIN"]
                                <label class="disblock">
                                    <input name="roleIds" type="checkbox" value="${role.id}" />
                                    ${role.roleName}&nbsp;&nbsp;
                                </label>
                                <br/>
                                [/#if]
                            [/#list]
                        </td>
                    </tr>
				</table>
				<p class="save">
					<input type="submit" value="保存" class="red">
					<input type="button" value="取消" class="red" id="backButton">
				</p>
            </div>
        </div>
    </form>
</body>
</html>